package chapter2.No2_3_volatile关键字.gSynchronized代码块有volatile同步的功能;

/**
 * Created by Administrator on 2016/11/16.
 */
public class Main {
    public static void main(String[] args) throws InterruptedException {
        ServiceClass sc = new ServiceClass();
        ThreadA a = new ThreadA(sc);
        a.setName("a");
        ThreadB b = new ThreadB(sc);
        b.setName("b");
        a.start();

        Thread.sleep(2000);
        b.start();
        System.out.println("END");
    }
}
